//
//  VipCustomerManager.h
//  CustomerServer
//
//  Created by 涂俊 on 2019/4/14.
//  Copyright © 2019 Facebook. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@protocol VipCustomerDelegate<NSObject>

@optional

// im登录结果
- (void)imLoginResult:(BOOL)result ;

// 接收到im消息
- (void)receiveImMessage:(NSArray *)aMessages;

// 接收到客服系统交互动作，回调游戏
- (void)receiveAction:(NSDictionary *)data;

@end


@interface VipCustomerManager : NSObject

@property (weak, nonatomic)id<VipCustomerDelegate> delegate;

+(instancetype) getInstance;

// 初始化
- (void)init:(NSDictionary *)opt params:(NSDictionary *)param log:(BOOL)log;

// 登录im
- (void)loginWithAppId:(NSString *)appId pubKey:(NSString *)pubKey uid:(NSString *)uid roleId:(NSString *)roleId;
- (void)loginWithAppId:(NSString *)appId pubKey:(NSString *)pubKey uid:(NSString *)uid roleId:(NSString *)roleId result:(void(^)(BOOL))resultBlock;

// 打开客服系统界面
- (void)open:(NSDictionary *)param controller:(UIViewController *)controller;

// 关闭客服系统
- (void)close;

- (UIViewController *)getViewController;

//获取未读消息
- (NSNumber *)getUnReadMsgNum;

//设置监听者
- (void)setDelegate:(id<VipCustomerDelegate>)delegate;

- (void)alert:(NSString *)msg;

@end

NS_ASSUME_NONNULL_END
